import request from '@/utils/request'

// 数据目录数
export const getDatacatalog = (params) => {
  return request({
    method: 'get',
    url: '/resource/datacatalog/resource/tree',
    params: params,
  })
}
// 新增目录
export const datacatalogAdd = (params) => {
  return request({
    method: 'post',
    url: '/resource/datacatalog/add',
    data: params,
  })
}
// 编辑目录
export const datacatalogEdit = (params) => {
  return request({
    method: 'post',
    url: `/resource/datacatalog/update`,
    data: params,
  })
}
// 数据目录数
export const datacatalogDelete = (params) => {
  return request({
    method: 'delete',
    url: '/resource/datacatalog/delete',
    params: params,
  })
}

// 服务列表
export const getLayerList = (params) => {
  return request({
    method: 'get',
    url: '/resource/service/query',
    params: params,
  })
}
// 服务详情
export const layerDetail = (params) => {
  return request({
    method: 'get',
    url: '/resource/service/get',
    params: params,
  })
}
// 新增服务
export const layerAdd = (params) => {
  return request({
    method: 'post',
    url: '/resource/service/add',
    data: params,
  })
}
// 编辑服务
export const layerEdit = (params) => {
  return request({
    method: 'put',
    url: `/resource/service/update/${params.pkid}`,
    data: params,
  })
}
// 删除服务
export const layerDelete = (params) => {
  return request({
    method: 'delete',
    url: '/resource/service/delete',
    params: params,
  })
}
